<template>
	<mobile-content :readOnly="false" :mobileLayout="mobileConfig" :screenConfig="screenConfig" :screenView="screenView"></mobile-content>
</template>

<script>
import ScreenViewManageApi from "@/api/screen/core/screen-view-manage.js";
import MobileContent from "@/views/modules/design/mobile/mobile-content.vue"
export default {
	name: "preview-mobile",
	components:{
        MobileContent
	},
	data(){
		return{
			//大屏对象
			screenView:"",
			//大屏组件
			screenConfig:{},
			mobileConfig:[],
		}
	},
	created(){
		this.init()
	},
	methods:{
		init(){
			ScreenViewManageApi.getByAlias(this.$route.params.alias).then(res=>{
				if(!res.success){
					this.$message.warning(res.message);
					return;
				}
				this.screenView=res.data;
				this.screenConfig=JSON.parse(this.screenView.config);
				if( res.data.mobileConfig){
					this.mobileConfig = JSON.parse(res.data.mobileConfig)
				}
			});
		}
	}
}
</script>

<style scoped>

</style>
